const SCREENSAVER_SCHEMA = 'org.gnome.desktop.screensaver';
const LOCK_ENABLED_KEY = 'lock-enabled';
-const CURTAIN_SLIDE_TIME = 1.2;
+const CURTAIN_SLIDE_TIME = 0.8;
// fraction of screen height the arrow must reach before completing
// the slide up automatically
const ARROW_DRAG_TRESHOLD = 0.1;
// STANDARD_FADE_TIME is used when the session goes idle, while
// SHORT_FADE_TIME is used when requesting lock explicitly from the user menu
const STANDARD_FADE_TIME = 10;
-const SHORT_FADE_TIME = 2;
+const SHORT_FADE_TIME = 0.8;
const Clock = new Lang.Class({
Name: 'ScreenShieldClock',
},
});
+const LockDialogGroup = new Lang.Class({
+ Name: 'LockDialogGroup',
+ Extends: St.Widget,
+
+ _init: function(params) {
+ this.parent(params);
+ },
+
+ vfunc_get_preferred_height: function(forWidth) {
+ return [global.screen_height, global.screen_height];
+ },
+
+ vfunc_get_preferred_width: function(forHeight) {
+ return [global.screen_width, global.screen_width];
+ }
+});
+
/**
* To test screen shield, make sure to kill gnome-screensaver.
*
y_expand: true,
reactive: true,
can_focus: true,
- layout_manager: new Clutter.BinLayout()
+ layout_manager: new Clutter.BinLayout(),
+ name: 'lockScreenGroup',
});
this._lockScreenGroup.connect('key-release-event',
Lang.bind(this, this._onLockScreenKeyRelease));
action.connect('drag-end', Lang.bind(this, this._onDragEnd));
this._lockScreenGroup.add_action(action);
- this._lockDialogGroup = new St.Widget({ x_expand: true,
- y_expand: true });
-
+ this._lockDialogGroup = new LockDialogGroup({ name: 'lockDialogGroup' });
this.actor.add_actor(this._lockDialogGroup);
this.actor.add_actor(this._lockScreenGroup);
},
_resetLockScreen: function(animate) {
+ this._lockScreenGroup.show();
+ this._arrow.show();
+
if (animate) {
- this.actor.opacity = 0;
- Tweener.removeTweens(this.actor);
- Tweener.addTween(this.actor,
- { opacity: 255,
+ this._lockScreenGroup.y = -global.screen_height;
+ Tweener.removeTweens(this._lockScreenGroup);
+ Tweener.addTween(this._lockScreenGroup,
+ { y: 0,
time: SHORT_FADE_TIME,
- transition: 'easeOutQuad',
+ transition: 'linear',
onComplete: function() {
+ this._lockScreenGroup.fixed_position_set = false;
this.emit('lock-screen-shown');
},
onCompleteScope: this
});
+
+ this._lockDialogGroup.opacity = 0;
+ Tweener.removeTweens(this._lockDialogGroup);
+ Tweener.addTween(this._lockDialogGroup,
+ { opacity: 255,
+ time: SHORT_FADE_TIME,
+ transition: 'easeOutQuad' });
} else {
+ this._lockScreenGroup.fixed_position_set = false;
+ this._lockDialogGroup.opacity = 255;
this.emit('lock-screen-shown');
}
- this._lockScreenGroup.fixed_position_set = false;
- this._lockScreenGroup.show();
- this._arrow.show();
-
this._lockScreenGroup.grab_key_focus();
},